using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Legend.Threading
{
    /// <summary>
    /// Represents a read lock held until the dispose method is called.
    /// Can be upgraded to a write lock.
    /// </summary>
    public interface IUpgradableReadLock
            : IDisposable
    {
        /// <summary>
        /// Upgrades the lock to a write lock.
        /// </summary>
        /// <returns>An object that holds the write lock until
        /// dispose is called on it.</returns>
        IDisposable Upgrade();
    }
}
